function yields_cu = getYields(model,x_cu)

[nn,T] = size(x_cu);
if nn > T
    x_cu = x_cu';
    [nn,T] = size(x_cu);
end
maxMaturity  = size(model.by0,1);
yields_cu    = zeros(maxMaturity,T);
if model.pruningOn == 1
    xf_cu  = x_cu(1:model.nx,:);
    if model.appOrder > 1
        xs_cu = zeros(model.nx,T);
        xs_cu(1:model.nx1,:) = x_cu(model.nx+1:model.nx+model.nx1,:);
    end
    if  model.appOrder > 2
        xrd_cu = zeros(model.nx,T);
        xrd_cu(1:model.nx1,:) = x_cu(model.nx+model.nx1+1:model.nx+2*model.nx1,:);
    end
    for t=1:T
        if model.appOrder == 1
            yields_cu(:,t) = model.by0 + model.byx*xf_cu(:,t);
        elseif model.appOrder == 2
            AA_cu = kron3(xf_cu(:,t),xf_cu(:,t));
            yields_cu(:,t) = model.by0 + model.byx*(xf_cu(:,t)+xs_cu(:,t)) + model.Byxx*AA_cu;
        elseif model.appOrder == 3
            AA_cu = kron3(xf_cu(:,t),xf_cu(:,t));
            BB_cu = kron3(xs_cu(:,t),xf_cu(:,t));
            yields_cu(:,t) = model.by0 + model.byx*(xf_cu(:,t)+xs_cu(:,t)+xrd_cu(:,t)) ...
                + model.Byxx*(AA_cu + 2*BB_cu) + model.Byxxx*kron3(AA_cu,xf_cu(:,t));
        end
    end        
else
    for t=1:T
        yields_cu(:,t) = model.by0 + model.byx*x_cu(:,t);
        if model.appOrder > 1
            AA_cu = kron3(x_cu(:,t),x_cu(:,t));
            yields_cu(:,t) = yields_cu(:,t) + model.Byxx*AA_cu;
        end
        if model.appOrder > 2
            yields_cu(:,t) = yields_cu(:,t) + model.Byxxx*kron3(AA_cu,x_cu(:,t));
        end
    end
end

end